﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MoqContrib.AutoMock.CommonService.Tests
{
    public class TestContainer : CommonServiceLocator.AutoMockContainer, All.Tests.IDoContainerStuff
    {
        public TestContainer() : base(new CommonServiceLocator.AutoMockHelper())
        {
        }
        #region IDoContainerStuff Members

        public IAutoMocker Helper
        {
            get { return _helper; }
            set { _helper = value; }
        }

        public void RegisterServiceAs<TService>(TService instance) where TService : class
        {
            // This is a tough one, definitely not normal
            Mock.Get<TService>();
        }

		public void RegisterService<TService>() where TService : class { }

        public TService CreateTestSubject<TService>() where TService : class
        {
            return Mock.CreateTestSubject<TService>();
        }

        public void RegisterServiceAs<TService, TComponent>()
            where TService : class
            where TComponent : TService
        {
            throw new NotImplementedException();
        }

		public void Dispose() { }

		public TService ResolveService<TService>() where TService : class
		{
			return Mock.Of<TService>();
		}

		#endregion
	}
}
